/**
 * 
 */
package V2c02;

import java.io.File;
import java.io.IOException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.xml.sax.SAXException;

/**
 * @author gjunming@gmail.com
 * @version Aug 19, 2009 5:27:28 PM
 */
public class XmlDomTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		try {
			DocumentBuilder builder = factory.newDocumentBuilder();
			File xmldomtest = new File(
					"E:\\javaprojects\\java-tutorial\\corejava\\src\\v2c02\\XmlDomTest.xml");
			Document xmldom = builder.parse(xmldomtest);
			System.out.println(xmldom.getDocumentElement().getTextContent());

		} catch (ParserConfigurationException e) {
			e.printStackTrace();
		} catch (SAXException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}
